
from starlette.endpoints import HTTPEndpoint
from starlette.responses import JSONResponse
from database import Session, engine
import datetime
from dao import DaoStationMonRep


# 供电所指标排名月报
class StationMonRep(HTTPEndpoint):

    async def get(self, request):
        session = Session()
        try:
            bureauid = request.query_params["bureauid"]
            monthnum = request.query_params["monthnum"]
            return  DaoStationMonRep.get_monthrep_info(session, bureauid, monthnum)
        finally:
            session.close()